"""应用入口。"""

from __future__ import annotations

import sys

from PySide6.QtWidgets import QApplication

from src.core.audit import audit_logger
from src.core.logger import setup_logging
from src.ui.main_window import MainWindow


def main() -> int:
    # 初始化日志系统
    setup_logging(level="INFO", log_to_file=True, log_to_console=True)
    
    # 记录应用启动
    audit_logger.log("app_start", result="success")

    app = QApplication(sys.argv)
    base_font = app.font()
    if base_font.pointSize() > 0:
        base_font.setPointSize(base_font.pointSize() + 2)
    elif base_font.pixelSize() > 0:
        base_font.setPixelSize(base_font.pixelSize() + 2)
    app.setFont(base_font)
    window = MainWindow()
    window.show()
    return app.exec()


if __name__ == "__main__":
    raise SystemExit(main())

